/**
 * Created by Administrator on 2017/7/8.
 */
/*menu begin*/
var lux=[],
    jinx=[];
$.getJSON(getApi+"/api/getindexmenu",function(data){
     lux=data.result;
    var arr =[],
        arr1=[];
    $(lux).each(function(e){
        if(e!=7){
            arr.push( "<a href='"+this.titlehref+"' class='col-xs-3 col-sm-3 menu_son'>" +
                this.img +
                "<p>"+this.name+"</p>" +
                "</a>")
        }else{
            arr.push( "<a href='"+this.titlehref+"' class='col-xs-3 col-sm-3 menu_son' id='menu_click'>" +
                this.img +
                "<p>"+this.name+"</p>" +
                "</a>")
        }

    })
    $(arr).each(function(e){
        if(e<=7){
            arr1.push(this)
        }
    })
    $("#menu").html(arr1.join(""));
    $("#menu_click").on("click",function(){
        $("#menu").html(arr.join(""))
    })
})
/*menu over*/

/*recommend begin*/
$.getJSON(getApi+"/api/getmoneyctrl",function(data){
    jinx=data.result;
    console.log(jinx);
    var arr =[];
    $(jinx).each(function(){
        arr.push("<div class='re_c_son'>" +
            this.productImgSm+
            "<div class='fr col-xs-8 col-sm-8'>" +
            "<div>" +
            "<a>"+this.productName+"<span class='re_red'>"+this.productPinkage+"</span></a>" +
            "</div>" +
            "<div class='re_r_b'>" +
            "<div class='fl'>" +
            "<span>"+this.productFrom+"</span><span>"+this.productTime+"</span>" +
            "</div>" +
            "<div class='fr'>" +
            "<span>✈</span>" +
            "<span>"+this.productComCount+"</span>" +
            "</div>" +
            "</div>" +
            "</div>" +
            "</div>")})
    $("#re_center").html(arr.join(""));
})
/*recommend over*/

